import {lazy} from 'react'
const Cart = lazy(()=>import('../pages/cart.jsx'))
const Cate = lazy(()=>import('../pages/cate.jsx'))
const Goodsdetail = lazy(()=>import('../pages/goodsdetail.jsx'))
const Goodslist = lazy(()=>import("../pages/goodslist.jsx"))
const Login = lazy(()=>import("../pages/login.jsx"))
const Reg = lazy(()=>import("../pages/reg.jsx"))
const Index = lazy(()=>import("../pages/index.jsx"))
const Uncenter = lazy(()=>import("../pages/uncenter.jsx"))
const Coupon = lazy(()=>import("../pages/coupon"))
const page404 = lazy(()=>import("../pages/page404.jsx"))
const rules = [
    {   //首页
        path:"/",
        redirect:"/index",
        exact:true,
        requireLogin:false
    },
    {   //首页
        path:"/index",
        component:Index,
        exact:true,
        requireLogin:false
    },
    {  //购物车
        path:"/cart",
        component:Cart,
        exact:true,
        requireLogin:true
    },
    {    //商品目录
        path:"/cate",
        component:Cate,
        exact:true,
        requireLogin:false
    },
    {     //商品详情
        path:"/goodsdetail",
        component:Goodsdetail,
        exact:true,
        requireLogin:true
    },
    {    //商品列表
        path:"/goodslist",
        component:Goodslist,
        exact:true,
        requireLogin:true
    },
    {   //登录
        path:"/login",
        component:Login,
        exact:true,
        requireLogin:false
    },
    {    //注册
        path:"/reg",
        component:Reg,
        exact:true,
        requireLogin:false
    },
    {  //个人中心
        path:"/uncenter",
        component:Uncenter,
        exact:true,
        requireLogin:true
    },
    {//
        path:"/coupon",
        component:Coupon,
        exact:true,
        requireLogin:true
    },
    {//优惠劵
        path:"*",
        component:page404,
        exact:false,
        requireLogin:false
    }

]

export default rules